﻿using System.Web.Mvc;
using System.Web.Routing;
using BemEstarEmprego.Entities.Sessions;

namespace BemEstarEmprego.Web.Controllers
{
	public class BaseController : Controller
	{

		public UsuarioSession userSession;

		protected override void HandleUnknownAction(string actionName)
		{
			if (ActionInvoker.InvokeAction(ControllerContext, "UnknownAction"))
				return;
		}

		public ActionResult UnknownAction()
		{
			return RedirectToAction("Index", "Home");
		}

		protected override void Initialize(RequestContext requestContext)
		{
			userSession = new UsuarioSession().GerarInstancia();
			base.Initialize(requestContext);
		}

	}
}
